// 统一管理用户相关接口
import request from '@/utils/request'
import type {
  loginFormData,
  userInfoResponseDate,
  loginResponseData,
} from './type'
enum API {
  LOGIN_URL = 'http://sph-api.atguigu.cn/api/user/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}

export const reqLogin = (data: loginFormData) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data)
export const reqUserInfo = () =>
  request.get<any, userInfoResponseDate>(API.USERINFO_URL)
export const reqLogOut = () => request.post<any>(API.LOGOUT_URL)
